package com.wiscamp.ninechapters.problems.infrastructure.converters;

import com.wiscamp.ninechapters.problems.domain.models.exams.ExamTypeRelation;
import com.wiscamp.ninechapters.problems.infrastructure.po.exams.ExamTypeRelationPO;
import com.wiscamp.ninechapters.problems.infrastructure.po.exams.ExamTypeRelationView;
import org.mapstruct.Mapper;
import org.mapstruct.MappingTarget;
import org.mapstruct.NullValuePropertyMappingStrategy;
import org.mapstruct.ReportingPolicy;
import org.mapstruct.factory.Mappers;

@Mapper(componentModel = "spring",
        unmappedTargetPolicy = ReportingPolicy.IGNORE,
        unmappedSourcePolicy = ReportingPolicy.IGNORE,
        nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE)
public interface ExamTypeRelationConverter {
    ExamTypeRelationConverter Instance = Mappers.getMapper(ExamTypeRelationConverter.class);

    ExamTypeRelationPO toExamTypeRelationPO(ExamTypeRelation entity);

    ExamTypeRelationPO toExamTypeRelationPO(ExamTypeRelation entity, @MappingTarget ExamTypeRelationPO po);

    ExamTypeRelation toExamTypeRelation(ExamTypeRelationPO po);

    ExamTypeRelation toExamTypeRelationByView(ExamTypeRelationView view);
}
